	function discount($field, $value, $fieldinfo) {
    	$table='<script language="javascript">
$(function(){   
 var i = 2;   
 $(\'#discount_add\').click(function(){   
  if(i < 100) {   
   $(\'#discount\').append(\'<div style="margin-top:5px;"><a href="javascript:;" id="discount_del">[—]</a>数量满  <input type="text" size="8"  class="input-text" name=info['.$field.'][1][\'+ i +\']\>  享受优惠折扣  <input type="text" size="8"  class="input-text" name=info['.$field.'][2][\'+ i +\']\></div>\');   
   i++;   
  } else {   
   alert("最多加100个");   
  }   
     
 });   
 $(\'.discount_del\').live(\'click\',function(){   
 $(this).parent().remove();   
 i--;   
 });   
 $(\'#discount_del\').live(\'click\',function(){   
 $(this).parent().remove();   
 i--;   
 });   
});   

  </script>';
 if($value){
		$value = unserialize($value);
		$discount = array_combine($value['1'], $value['2']);
		$i=1;
		foreach($discount as $_k=>$_v){
			if($i==1){
				$table .=' <div id="discount" style="margin-top:5px;"><a href="javascript:;" id="discount_add">[+]</a>
数量满 <input type="text" class="input-text" value="'.$_k.'" size="8" name="info['.$field.'][1][1]">
享受优惠折扣 <input type="text"  class="input-text" value="'.$_v.'" size="8" name="info['.$field.'][2][1]"></div>';
				}else{
			$table .=' <div style="margin-top:5px;"><a href="javascript:;" id="discount_del">[-]</a>
数量满 <input type="text" class="input-text" value="'.$_k.'" size="8" name="info['.$field.'][1][1]">
享受优惠折扣 <input type="text"  class="input-text" value="'.$_v.'" size="8" name="info['.$field.'][2][1]"></div>';
				}
			$i++;
			}
	
	   }else{
$table .=' <div id="discount"><a href="javascript:;" id="discount_add">[+]</a>
数量满 <input type="text" class="input-text" value="" size="8" name="info['.$field.'][1][1]">
享受优惠折扣 <input type="text"  class="input-text" value="" size="8" name="info['.$field.'][2][1]"></div>';
	   }
		return $table;
	}
